//
//  EduExperienceListVC.m
//  jzyParents
//
//  Created by 任辰东 on 2025/2/17.
//

#import "EduExperienceListVC.h"
#import "EduExperienceTCell.h"
#import "MineApis.h"

@interface EduExperienceListVC ()

@end

@implementation EduExperienceListVC

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.
    
    self.navigationItem.title = @"教育经历";
    
    [self setupEstimatedRowHeight:120 cellClasses:@[[EduExperienceTCell class]]];
    
    [self beginRefresh];
}

-(void)requestDataWithOffset:(NSInteger)offset success:(void (^)(NSArray *))success failure:(void (^)(NSString *))failure
{
    NSMutableDictionary *params = [NSMutableDictionary dictionary];
    params[@"id_card"] = [GVUserDefaults standardUserDefaults].id_card;

    WeakSelf
    [MineApis jzxx_JiaoyuJingliListRequestWithParams:params SuccessBlock:^(NSNumber *code, NSString *msg, id responseData) {
        StrongSelf
        [self hideLoadingHUD];

        NSArray *data = [EduExperienceModel mj_objectArrayWithKeyValuesArray:responseData];
        success(data);
        [self addEmptyView];
        
        } FailureBlock:^(NSNumber *code, NSString *msg) {
        StrongSelf
            [self showWarningHUDWithMessage:msg completion:NULL];
        }];
}

-(void)addEmptyView
{
    if (IsEmpty(self.dataSourceArr)) {
        [RCDEmptyView addEmptyWithStyle:EmptyViewStyleCommon onView:self.myTableView position:EmptyViewPositionCenter clickCallBack:nil];
    }else{
        [RCDEmptyView removeFromParentView:self.myTableView];
    }
}

@end
